﻿using System;
using System.Data;

namespace BizElements.Core.ProviderComponents
{
    /// <summary>Builds <see cref="BizElements.Core.IConnectionProvider"/> objects.</summary>
    public interface IConnectionProviderBuilder
    {
        /// <summary>Creates a new connection provider, ie. connection-transaction context.</summary>
        /// <param name="dbms">DBMS type to which this provider connects to.</param>
        /// <param name="connectionString">Connection string.</param>
        /// <returns>Connection provider.</returns>
        IConnectionProvider BuildConnectionProvider(DbmsType dbms, string connectionString);

        /// <summary>Creates a new connection provider, ie. connection-transaction context.</summary>
        /// <param name="dbms">DBMS type to which this provider connects to.</param>
        /// <param name="connectionString">Connection string.</param>
        /// <param name="defaultIsolationLevel">Isolation level for transactions started by the parameterless <see cref="BizElements.Core.IConnectionProvider.BeginTransaction()"/> method overload.</param>
        /// <returns>Connection provider.</returns>
        IConnectionProvider BuildConnectionProvider(DbmsType dbms, string connectionString, IsolationLevel defaultIsolationLevel);
    }
}
